-
Notifications
You must be signed in to change notification settings - Fork 549
refactor(presence): Pass arguments as an object to StateFactory.latest/latestMap #24414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Latest and LatestMap functions to accept a single object argument instead of multiple parameters, consolidating common options under the PresenceStateOptions interface. Key changes include:
- Updating test cases to pass objects with an "initialValue" property.
- Modifying the signature and internal implementation of Latest and LatestMap functions.
- Re-exporting the new interfaces in the package index and API report.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/framework/presence/src/test/presenceStates.spec.ts | Updated test to use the new object argument for Latest. |
packages/framework/presence/src/test/latestValueManager.spec.ts | Updated tests to reflect the new Latest signature. |
packages/framework/presence/src/test/latestMapValueManager.spec.ts | Updated tests to use the new object argument for LatestMap. |
packages/framework/presence/src/test/eventing.spec.ts | Updated tests in eventing to pass new argument objects. |
packages/framework/presence/src/test/batching.spec.ts | Adjusted batching tests to use the new signatures. |
packages/framework/presence/src/latestValueTypes.ts | Added the PresenceStateOptions interface. |
packages/framework/presence/src/latestValueManager.ts | Modified Latest signature to accept a LatestProps object. |
packages/framework/presence/src/latestMapValueManager.ts | Modified LatestMap signature to accept a LatestMapProps object. |
packages/framework/presence/src/index.ts | Re-exported the new types. |
packages/framework/presence/api-report/presence.alpha.api.md | Updated API report with the new signatures and types. |
examples/apps/presence-tracker/src/MouseTracker.ts | Updated usage of Latest with the object argument. |
examples/apps/presence-tracker/src/FocusTracker.ts | Updated usage of Latest with the new object argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good, just a nit below.
I was going to resolve the conflicts to help. I staged it locally and was going to use github UI to make the changes, but there are test changes needed too. So, I have them in a branch. Published to https://github.com/microsoft/FluidFramework/tree/presence/obj-args (merge to your branch with fast forward) |
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
This change updates the signatures of the Latest/LatestMap functions to accept an object as the only argument. The arguments have been named to align with other parts of the API (e.g.
local
).